
#include	<iostream>

#include	"zig/url.hpp"

using namespace std;
using namespace zig;

int		main( void )
{
	
	{
		const char* pszUrl = "http://www.google.com/doc/reader?name=search#anchor1";
		
		URL	url( pszUrl );
		cout<< "URL: " << url.url() << endl
			<< "protocol: " << url.protocol() << endl
			<< "hostname: " << url.hostname() << endl
			<< "port: " << url.port() << endl
			<< "path: " << url.path() << endl
			<< "query: " << url.query() << endl
			<< "anchor: " << url.anchor() << endl
			<< endl;
	}

	{
		const char* pszUrl = "http://www.google.com:80/doc/reader?name=search#anchor1";
		
		URL	url( pszUrl );
		cout<< "URL: " << url.url() << endl
			<< "protocol: " << url.protocol() << endl
			<< "hostname: " << url.hostname() << endl
			<< "port: " << url.port() << endl
			<< "path: " << url.path() << endl
			<< "query: " << url.query() << endl
			<< "anchor: " << url.anchor() << endl
			<< endl;
	}

	{
		const char* pszUrl = "http://www.google.com:80/reader";
		
		URL	url( pszUrl );
		cout<< "URL: " << url.url() << endl
			<< "protocol: " << url.protocol() << endl
			<< "hostname: " << url.hostname() << endl
			<< "port: " << url.port() << endl
			<< "path: " << url.path() << endl
			<< "query: " << url.query() << endl
			<< "anchor: " << url.anchor() << endl
			<< endl;
	}

	{
		const char* pszUrl = "http://www.google.com:80/?name=search";
		
		URL	url( pszUrl );
		cout<< "URL: " << url.url() << endl
			<< "protocol: " << url.protocol() << endl
			<< "hostname: " << url.hostname() << endl
			<< "port: " << url.port() << endl
			<< "path: " << url.path() << endl
			<< "query: " << url.query() << endl
			<< "anchor: " << url.anchor() << endl
			<< endl;
	}

	{
		const char* pszUrl = "http://www.google.com:80?name=search";
		
		URL	url( pszUrl );
		cout<< "URL: " << url.url() << endl
			<< "protocol: " << url.protocol() << endl
			<< "hostname: " << url.hostname() << endl
			<< "port: " << url.port() << endl
			<< "path: " << url.path() << endl
			<< "query: " << url.query() << endl
			<< "anchor: " << url.anchor() << endl
			<< endl;
	}

	{
		const char* pszUrl = "http://www.google.com:80#name=search";
		
		URL	url( pszUrl );
		cout<< "URL: " << url.url() << endl
			<< "protocol: " << url.protocol() << endl
			<< "hostname: " << url.hostname() << endl
			<< "port: " << url.port() << endl
			<< "path: " << url.path() << endl
			<< "query: " << url.query() << endl
			<< "anchor: " << url.anchor() << endl
			<< endl;
	}

	{
		const char* pszUrl = "unix:///www/google/com#name=search";
		
		URL	url( pszUrl );
		cout<< "URL: " << url.url() << endl
			<< "protocol: " << url.protocol() << endl
			<< "hostname: " << url.hostname() << endl
			<< "port: " << url.port() << endl
			<< "path: " << url.path() << endl
			<< "query: " << url.query() << endl
			<< "anchor: " << url.anchor() << endl
			<< endl;
	}

	return	0;
}
